Add Docker base image caching to reduce build times #256
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements Docker base image caching to significantly reduce build times by storing the time-consuming npm dependencies installation step as a reusable image.
Changes Made
Modified
on_call_build_site.yaml
: Addedpush_tag
input parameter and two new steps:ghcr.io/orionrobots/orionrobots-site.base
) before the main site buildModified
on_push_to_master_test_and_deploy.yaml
: Addedpush_tag: "latest"
to cache base images for the main branch and updated action dependencies.Modified
on_pr_test.yaml
: Added intelligent change detection usingtj-actions/changed-files
to only push base images when relevant files change (Dockerfile, package.json/lock, workflows).Updated action dependencies: Replaced stale
dorny/paths-filter
action with actively maintainedtj-actions/changed-files
v44.5.7 across all workflows.Build Process Flow
latest
Smart Change Detection
The PR workflow detects changes to base image-affecting files:
Dockerfile
package.json
/package-lock.json
Only PRs modifying these files will push a new base image, avoiding unnecessary registry bloat.
Benefits
npm ci
step (taking 3+ minutes) is now cached and reusabletj-actions/changed-files
instead of staledorny/paths-filter
Fixes #255.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.